package com.practice;

public class MyThread extends Thread {
    public MyThread(String name){
        super(name);
    }
    @Override
    public void run() {
        for (int i = 0; i <1001 ; i++) {
            System.out.println(Thread.currentThread().getName() + "运行了" + i + "次");
        }
    }

    public static void main(String[] args) {
        MyThread myThread = new MyThread("MyThread线程");
        myThread.start();
        for (int i = 0; i <1001 ; i++) {
            System.out.println("main线程运行了" + i + "次");
        }
    }
}
